﻿CREATE TABLE [dbo].[codeCallOutcome] (
    [CallOutcomeCode]       INT          IDENTITY (1, 1) NOT NULL,
    [Description]         VARCHAR (50) NOT NULL,
    [Active]              BIT          NOT NULL,
    [CampaignID]          INT          NULL,
    [Complete]            BIT          NOT NULL,
    [CallTypeCode]          char(1)          NULL,
    [ParentCallOutcomeCode] INT          NULL,
    [Save]                BIT          NULL,
    [Cancel]              BIT          NULL,
    [ClubCode]            BIT          NULL,
    [CallOutcomeGroupCode]  INT          NULL
);
GO
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Defines the outcome ids and their properties .  Used in outbound campaigns.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'codeCallOutcome';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'call outcome ID', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'codeCallOutcome',
	@level2type = N'COLUMN', @level2name = N'CallOutcomeCode';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Definition for CallOutcomeCode.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'codeCallOutcome',
	@level2type = N'COLUMN', @level2name = N'Description';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Defines whether or not the CallOutcomeCode is active.  1 it is active, 0 it is not.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'codeCallOutcome',
	@level2type = N'COLUMN', @level2name = N'Active';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Campaign Id', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'codeCallOutcome',
	@level2type = N'COLUMN', @level2name = N'CampaignID';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Defines whether this call is in a state of completion.  1 if it is, 0 otherwise.
 If a call is complete then customer service reps will not attempt to contact this
person again', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'codeCallOutcome',
	@level2type = N'COLUMN', @level2name = N'Complete';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Defines the type of call by a code.  See codeCallType.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'codeCallOutcome',
	@level2type = N'COLUMN', @level2name = N'CallTypeCode';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Defines which CallOutcomeCode is the parent, if any.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'codeCallOutcome',
	@level2type = N'COLUMN', @level2name = N'ParentCallOutcomeCode';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Defines whether the call resulted in saving the order if it is 1 otherwise 0', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'codeCallOutcome',
	@level2type = N'COLUMN', @level2name = N'Save';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Defines whether the call resulted in cancelling the order if it is 1 otherwise 0', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'codeCallOutcome',
	@level2type = N'COLUMN', @level2name = N'Cancel';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Defines the club code', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'codeCallOutcome',
	@level2type = N'COLUMN', @level2name = N'ClubCode';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Id from call outcome group table', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'codeCallOutcome',
	@level2type = N'COLUMN', @level2name = N'CallOutcomeGroupCode';

